
var leftUrl = window.location.pathname;

var patt = /.*?\/$/;
if(patt.test(leftUrl)){
    leftUrl = leftUrl.substr(0, (leftUrl.length-1) );
}
var nn = leftUrl.split("/");
leftUrl = '/'+nn[1]+'/'+nn[2];

/*
 *用户管理
 */
if(leftUrl == '/user'){
    var className = '.user_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

if(leftUrl == '/user/list'){
    var className = '.staff_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
if(leftUrl == '/user/enroll'){
    var className = '.enroll_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

if(leftUrl == '/user/active'){
    var className = '.user_active_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
/*
    管理员
 */
if(leftUrl == '/admin/list' || leftUrl=='/admin/uedit'){
    var className = '.admin_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
if(leftUrl == '/admin/addu'){
    var className = '.admin_add';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
if(leftUrl == '/admin/authorlist' || leftUrl=='/admin/authoradd' || leftUrl=='/admin/authoredit'){
    var className = '.author_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

/**
 * 裂变者列表
 */
if(leftUrl == '/admin/share' ||leftUrl == '/admin/shareDetail'){
    var className = '.share_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}


/*
 *课程管理
 */
if(leftUrl == '/course/list' || leftUrl == '/course/create' || leftUrl == '/course/edit' || leftUrl == '/course/detail' || leftUrl == '/courseMessage/push'){
    var className = '.course_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

/*
 *课程列表
 */
//alert(leftUrl);
if(leftUrl == '/courseLearn/card' || leftUrl == '/course/card' || leftUrl == '/course/card'){
    var className = '.experience_card';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
if(leftUrl == '/train/course' ||leftUrl == '/train/ask' ||leftUrl == '/train/ask'){
    var className = '.train_course';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
/*
 *课程管理
 */
if(leftUrl == '/course/consultation'){
    var className = '.consultation_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

/**
 * 视频上传
 */
if(leftUrl =="/video/index" || leftUrl == "/video/add" ||leftUrl == "/video/edit" || leftUrl == "/qiniu/add"){
    var className = '.video_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

/*
 *标签管理
 */
if(leftUrl == '/tags/list' || leftUrl=='/tags/edittag'){
    var className = '.tag_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

/*
 *banner管理
 */
if(leftUrl == '/banner/list' || leftUrl=='/banner/add' || leftUrl=='/banner/editbanner'){
    var className = '.banner_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

/*
 *banner管理
 */
if(leftUrl == '/ctype/list' || leftUrl == '/ctype/add' || leftUrl == '/ctype/cindex'){
    var className = '.ctype_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
/*
 *  财务管理
 */
if(leftUrl == '/finance/flow'){
    var className = '.finance_flow';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
if(leftUrl == '/finance/group'){
    var className = '.finance_group';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
if(leftUrl == '/apply/withdraw' || leftUrl == '/apply/detail' || leftUrl == '/apply/agree'){
    var className = '.withdraw_apply';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
/*
*常见问题
*/

if(leftUrl == '/help/index' || leftUrl == '/help/add' || leftUrl == '/help/update'){
    var className = '.help_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

/*
    意见反馈
 */

if(leftUrl == '/help/feedback'){
    var className = '.feed_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}


/**
 * comment评论
 */

if(leftUrl == '/comment/index'){
    var className = '.comment_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
if(leftUrl == '/comment/article'){
    var className = '.article_comment';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

/**
 * 赛普币规则
 */
if(leftUrl == '/rules/index' || leftUrl == "/rules/add" ||leftUrl == "/rules/edit"){
    var className = '.rules_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

/**
 * 微信管理
 */
if(leftUrl == '/wechat/index' || leftUrl == "/wechat/list"){
    var className = '.wechat_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
if(leftUrl == '/wechatSet/list' || leftUrl == "/wechatSet/keywordAdd" || leftUrl == "/wechatSet/keywordEdit"){
    var className = '.wechatSet_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
if(leftUrl == '/wechatSet/push' || leftUrl == "/wechatSet/push/updateSet" || leftUrl == "/wechatSet/push/set"){
    var className = '.subscribe_push_set';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
/**
 * 微信菜单栏
 */
if(leftUrl == '/wechat/menu' || leftUrl == "/wechat/menuAdd" || leftUrl == 'wechat/menuUpdate'){
    var className = '.menu_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

if(leftUrl == '/wechat/news'){
    var className = '.wechat_news';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

/**
 * 微信自动回复
 */
if(leftUrl == '/wechatReply/index' || leftUrl == '/wechatReply/add' || leftUrl == '/wechatReply/edit'){
    var className = '.wechatReply_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

/**
 * 文章管理
 */
if(leftUrl == '/type/list' || leftUrl=='/type/add' || leftUrl=='/type/edit'){
    var className = '.types';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
/**
 *  * 网站设置
 */
if(leftUrl == '/establish/index'){
    var className = '.establish_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

if(leftUrl == '/establish/update'){
    var className = '.update_site';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
if(leftUrl == '/establish/showAllKey'){
    var className = '.showAllKey';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

/**
 * 用户余额
 */

if(leftUrl == '/balance/index' ||leftUrl == '/balance/detail'){
    var className = '.balance_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}


if(leftUrl == '/search/index'){
    var className = '.search_index';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

if(leftUrl == '/article/list' || leftUrl=='/article/add' || leftUrl=='/article/edit'){
    var className = '.article_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

if(leftUrl == '/activity/list' || leftUrl=='/activity/add' || leftUrl=='/activity/edit'){
    var className = '.activity_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

if(leftUrl == '/article/recommend'){
    var className = '.recommend_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}


//专题页微信名称
if(leftUrl == '/admin/wechatName'){
    var className = '.wechatName_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

//专题页微信名称
if(leftUrl == '/special/index' || leftUrl == '/special/articleList' || leftUrl == '/special/edit_special'){
    var className = '.special_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
//专题消息推送
if(leftUrl == '/'){
    var className = '.thematic_news';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
//赛事管理
if(leftUrl == '/match/index'){
    var className = '.match_index';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
if(leftUrl == '/match/add'){
    var className = '.match_add';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}


//临时活动管理
if(leftUrl == '/activity/jdcard'){
    var className = '.jdcard_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
//临时活动管理
if(leftUrl == '/activity/new'){
    var className = '.newyear_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

//分销管理
if(leftUrl == '/dis/video' || leftUrl == '/dis/videou' || leftUrl=='/dis/videoa'){
    var className = '.dis_course_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}

if(leftUrl == '/dis/course' || leftUrl == '/dis/coursea' || leftUrl=='/dis/courseu'){
    var className = '.dis_video_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}
if(leftUrl == '/dis/list'){
    var className = '.dis_list';
    $(className).addClass('active');
    $(className).parent().addClass('in');
    $(className).parent().parent().prev().children('.nav-header').removeClass('collapsed');
}